import {defineStore} from 'pinia'
import type {IUserInfoProps} from '@/interface/user'

const useUserInfo = defineStore('userInfo',{
    // 模块的初始数据
    state:()=>{
        return {
            permissions:[] as string[],
            user:{} as IUserInfoProps,
            menus:[]
        }
    },
    persist:true,
    actions:{
        updateUser(payload:any){
            this.permissions = payload.permissions;
            this.user = payload.user;
            
        },
        updateMenu(payload:any){
            this.menus = payload;
        }
    }

})

export {useUserInfo}